package com.androidx.p013lv.mine.adapter;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.utils.TimeUtils;
import com.androidx.p013lv.mine.C1207R;
import com.androidx.p013lv.mine.bean.WalletHistoryBean;
import org.slf4j.Marker;

/* renamed from: com.androidx.lv.mine.adapter.WalletHistoryAdapter */
public class WalletHistoryAdapter extends BaseRecyclerAdapter<WalletHistoryBean, Holder> {
    public void MyHolder(Holder holder, int i) {
        holder.setData((WalletHistoryBean) getDataInPosition(i));
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C1207R.C1212layout.item_wallet_history_detail, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.mine.adapter.WalletHistoryAdapter$Holder */
    public static class Holder extends BaseRecyclerHolder {
        TextView tv_describe;
        TextView tv_price;
        TextView tv_remark;
        TextView tv_time;

        Holder(View view) {
            super(view);
            this.tv_describe = (TextView) view.findViewById(C1207R.C1210id.tv_describe);
            this.tv_time = (TextView) view.findViewById(C1207R.C1210id.tv_time);
            this.tv_price = (TextView) view.findViewById(C1207R.C1210id.tv_price);
            this.tv_remark = (TextView) view.findViewById(C1207R.C1210id.tv_remark);
        }

        /* access modifiers changed from: package-private */
        public void setData(WalletHistoryBean walletHistoryBean) {
            this.tv_describe.setText(walletHistoryBean.getDesc());
            this.tv_time.setText(TimeUtils.utcToChina(walletHistoryBean.getCreatedAt()));
            if (walletHistoryBean.getMark() == 1) {
                TextView textView = this.tv_price;
                textView.setText(Marker.ANY_NON_NULL_MARKER + walletHistoryBean.getAmount());
            } else {
                TextView textView2 = this.tv_price;
                textView2.setText("-" + walletHistoryBean.getAmount());
            }
            if (TextUtils.isEmpty(walletHistoryBean.getRemark())) {
                this.tv_remark.setVisibility(8);
                return;
            }
            TextView textView3 = this.tv_remark;
            textView3.setText("备注：" + walletHistoryBean.getRemark());
            this.tv_remark.setVisibility(0);
        }
    }
}
